package cn.edu.sjtu.se.peakfactory.service.bean;

import java.util.ArrayList;
import java.util.List;

import cn.edu.sjtu.se.lchang.socialnetwork.dao.bean.Tag;
import cn.edu.sjtu.se.lchang.socialnetwork.service.bean.TagVB;
import cn.edu.sjtu.se.peakfactory.dao.bean.Game;

public class GameVB {
	private Long id;
	private String name;
	private String description;
	private Integer type;
	private Long registerTime;
	private Integer playerCount;
	private String url;
	private String creator;
	private String normalPic;
	private String bigPic;
	private Boolean deleted;
	private List<TagVB> tags = new ArrayList<TagVB>();
	
	public GameVB(Game g) {
		id = g.getId();
		name = g.getName();
		description = g.getDescription();
		type = g.getType();
		registerTime = g.getRegisterTime() == null ? null : g.getRegisterTime()
				.getTime();
		playerCount = g.getPlayerCount();
		url = g.getUrl();
		creator = g.getCreator();
		normalPic = g.getNormalPic();
		bigPic = g.getBigPic();
		deleted = g.isDeleted();

		if (g.getTags() != null) {
			for (Tag t : g.getTags()) {
				tags.add(new TagVB(t));
			}
		}
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public List<TagVB> getTags() {
		return tags;
	}

	public void setTags(List<TagVB> tags) {
		this.tags = tags;
	}

	public Long getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Long registerTime) {
		this.registerTime = registerTime;
	}

	public Integer getPlayerCount() {
		return playerCount;
	}

	public void setPlayerCount(Integer playerCount) {
		this.playerCount = playerCount;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public String getNormalPic() {
		return normalPic;
	}

	public void setNormalPic(String normalPic) {
		this.normalPic = normalPic;
	}

	public String getBigPic() {
		return bigPic;
	}

	public void setBigPic(String bigPic) {
		this.bigPic = bigPic;
	}

	public Boolean getDeleted() {
		return deleted;
	}

	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
}
